
#include "main.h"
//**********************************************************

static pthread_t  main_thread;
//**********************************************************
void* main_timer_task(void *arg)
{
	struct timeval timer;	

	while(1)
	{
		usleep(1000);

		timer.tv_sec  = 1;
		timer.tv_usec = 0;

		switch(select(0, NULL, NULL, NULL, &timer)){
		case -1:  
			log_e("Error!\n");
			break;
		case 0: 
			break;
		default:break;}
	}
}


int main(int argc, char *argv[])
{
	int i     = 0;
	int ret   = 0;
	//******************************************************************
	log_i("******************************************************\n");
	log_i("*********************linux simu***********************\n");
	log_i("******************************************************\n");
	//******************************************************************
	lv_init();
	lib_sdl2_init();	
	lv_sdl2_hal_init();
	lv_sdl2_disp_init();
	lv_sdl2_mouse_init();
	lv_sdl2_keyboard_init();
	//******************************************************************
	lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_0, LV_PART_MAIN);
	lv_obj_set_scrollbar_mode(lv_scr_act(), LV_SCROLLBAR_MODE_OFF);
	//******************************************************************
	pthread_create(&main_thread, NULL, main_timer_task, NULL);
	//******************************************************************

	// ui_init_user_agreement_page_src(lv_scr_act());

	// test_obj_gesture_event();
	
	// com_loading_res_init();

	root_ctl_preinit();

	//com_anim_create(100,100);

	// collection_create_init();
	
	// test3_main();

	// root_page_create();

	// test4_setup_ui();

	// test_cjson_array();

	// test_spid_add();
	//******************************************************************
    while(1)
	{
		lv_timer_handler();
        SDL_Delay(5);
    }
	//******************************************************************

    return 0;
}

